<h1><code ng:non-bindable="">angular.module</code>
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><a href="http://github.com/angular/angular.js/edit/master/src/loader.js" class="improve-docs btn btn-primary">Improve
    this doc</a>

    <h2 id="Description">Description</h2>

    <div class="description">
        <div class="angular-module-page"><p>The <code>angular.module</code> is a global place for creating and
            registering Angular modules. All
            modules (angular core or 3rd party) that should be available to an application must be
            registered using this mechanism.</p>

            <h1 id="module">Module</h3>

                <p>A module is a collection of services, directives, filters, and configuration information.
                    <code>angular.module</code> is used to configure the <a
                            href="api/AUTO.$injector"><code>$injector</code></a>.</p>

<pre class="prettyprint linenums">
// Create a new module
var myModule = angular.module('myModule', []);

// register a new service
myModule.value('appName', 'MyCoolApp');

// configure existing services inside initialization blocks.
myModule.config(function($locationProvider) {
  // Configure existing providers
  $locationProvider.hashPrefix('!');
});
</pre>

                <p>Then you can create an injector and load your modules like this:</p>

<pre class="prettyprint linenums">
var injector = angular.injector(['ng', 'MyModule'])
</pre>

                <p>However it's more likely that you'll just use
                    <a href="api/ng.directive:ngApp"><code>ngApp</code></a> or
                    <a href="api/angular.bootstrap"><code>angular.bootstrap</code></a> to simplify this process for you.
                </p>
        </div>
    </div>
    <h2 id="Usage">Usage</h2>

    <div class="usage">
        <pre class="prettyprint linenums">angular.module(name[, requires], configFn);</pre>
        <h3 id="Parameters">Parameters</h3>
        <ul class="parameters">
            <li><code ng:non-bindable="">name – {!string} – </code>

                <div class="angular-module-page"><p>The name of the module to create or retrieve.</p></div>
            </li>
            <li><code ng:non-bindable="">requires<i>(optional)</i> – {Array.&lt;string&gt;=} – </code>

                <div class="angular-module-page"><p>If specified then new module is being created. If unspecified then
                    the
                    the module is being retrieved for further configuration.</p></div>
            </li>
            <li><code ng:non-bindable="">configFn – {Function} – </code>

                <div class="angular-module-page"><p>Optional configuration function for the module. Same as
                    <a href="api/angular.Module#config"><code>Module#config()</code></a>.</p></div>
            </li>
        </ul>
        <h3 id="Returns">Returns</h3>

        <div class="returns"><code ng:non-bindable="">{module}</code>
            –
            <div class="angular-module-page"><p>new module with the <a
                    href="api/angular.Module"><code>angular.Module</code></a> api.</p></div>
        </div>
    </div>
</div>
